#ifndef MYGLWIDGET_H
#define MYGLWIDGET_H

#include <QGLWidget>
#include <QImage>
#include <QtOpenGL>
#include "hyperboloid.h"
#include "tore.h"
#include "sphere.h"

class MyGLWidget : public QGLWidget
{
    Q_OBJECT
    public:
        explicit MyGLWidget(int framesPerSecond = 0, QWidget *parent = 0, char *name = 0);
        void initializeGL();
        void resizeGL(int width, int height);
        void paintGL();
        void keyPressEvent( QKeyEvent *keyEvent );

public:
        void chargerTexture();

    public slots:
        void setAngle(int angle);
        void timeOutSlot();

    signals:
        void angleChanged(int angle);

    private:
        QTimer *t_Timer;
        Hyperboloid *hyper;
        Tore *tore;
        Sphere *sphere;
        GLuint textureId;
        float angleRotation;
        bool textureChargee;
};

#endif // MYGLWIDGET_H
